{include file="public/header"}
<div class="page-content">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf" style=" height: 500px;">
            <div class="widget-head am-cf">
                <div class="widget-title am-cf">一级分类列表</div>
            </div>
            <div class="widget-body am-fr">
                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                    <div class="am-form-group">
                    </div>
                </div>
                <div class="am-u-sm-12">
                    <div>
                        <a class="layui-btn layui-btn-normal" href="addbclass">添加分类</a>
                    </div>
                    <table class="am-table am-table-compact am-table-striped tpl-table-black" id="dyntable">
                        <thead>
                        <tr>
                            <th class="head0 nosort">
                                <input type="checkbox" class="checkall" />
                            </th>
                            <th class="center">ID</th>
                            <th class="center">名称</th>
                            <th class="center">介绍</th>
                            <th class="center">排序</th>
                            <th class="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="bdata" id="vo"}
                        <tr class="gradeX">
                            <td class="aligncenter">
	                                <span class="center">
	                                    <input type="checkbox" />
	                                </span>
                            </td>
                            <td class="center">{$vo.id}</td>
                            <td class="center">{$vo.bname}</td>
                            <td class="left">{$vo.describe|substr=0,50}</td>
                            <td class="center">{$vo.orderno}</td>
                            <td class="center">
                                <a href="{:url('bclass/editbclass',['no'=>$vo.id])}">
                                    <i class="am-icon-pencil"></i>编辑
                                </a>
                                <a onclick="showDel('{$vo.id}','{$vo.bname}')"
                                   class="item-delete tpl-table-black-operation-del">
                                    <i class="am-icon-trash"></i> 删除
                                </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    {$bdata->render()}
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
    layui.use(['element','layer'], function(){
        var element = element;});

    function showDel(no,name) {
        var layer = layui.layer;
        layer.confirm('确认删除'+name+'？', {
            btn: ['确认', '取消'] //可以无限个按钮
        }, function (index, layero) {
            //按钮【按钮一】的回调
            location.href="{:url('bclass/del')}"+"?no="+no;
        }, function (index) {
            //按钮【按钮二】的回调
        });
    }
</script>

</body>
</html>
